﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Forms;

namespace Merge.Control {
    class Grid: DataGridView {
        public void InitGrid() {
            ReadOnly = true;
            AutoGenerateColumns = false;
            AllowUserToAddRows = false;
            AllowUserToDeleteRows = false;
            AllowUserToOrderColumns = false;
            AllowUserToResizeRows = false;
            AllowUserToResizeColumns = false;
            for (int i = 1; i < 15; i++) {
                var col = new DataGridViewTextBoxColumn();
                col.Width = 40;
                col.Visible = true;
                col.ReadOnly = true;
                col.HeaderText = i.ToString();
                col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                col.SortMode = DataGridViewColumnSortMode.NotSortable;
                Columns.Add(col);
            }

            var c = new DataGridViewTextBoxColumn();
            c.Width = 80;
            c.Visible = true;
            c.HeaderText = "中奖个数";
            Columns.Add(c);
        }
    }
}